package com.cskaoyan.shopping.controller;

import com.cskaoyan.mall.commons.result.ResponseData;
import com.cskaoyan.shopping.form.PageRequest;
import com.cskaoyan.shopping.service.IShoppingGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Author:WalterChan
 * @Decription:ShoppingGoodsController
 * @Date Created in 2023-01-11-9:59
 */
@RestController
@RequestMapping("/shopping")
public class ShoppingGoodsController {
    @Autowired
    IShoppingGoodsService shoppingGoodsService;
//shopping/goods
    @RequestMapping("/goods")
    public ResponseData shoppingGoods(PageRequest pageRequest){
//        调用IShoppingGoodsService传入 pageRequest
        ResponseData responseData =shoppingGoodsService.shoppingGoods(pageRequest);
//      返回DTO封装在ResponseData中返回
        return responseData;


    }

}
